home *** CD-ROM | disk | FTP | other *** search
- property pInfo, pVRCount, pState, ancestor
- global gDB, gCurrentQuestion, gTherm, gPicPath, gAudioPath
-
- on beginSprite me
- pVRCount = 2
- pState = #GETQUESTION
- gCurrentQuestion = sprite(me.spriteNum)
- sound playFile 1, gAudioPath & "voice\" & gDB.pCurrentSectionType & "intro.wav"
- end
-
- on exitFrame me
- case pState of
- #GETQUESTION:
- mGetQuestion(me)
- pState = #WAITAUDIO
- #WAITAUDIO:
- if not soundBusy(1) then
- pState = #NULL
- go("VRQuestion")
- end if
- end case
- end
-
- on mRevealAnswer me
- pState = #NULL
- member("Answer" & pInfo.Answer_Correct & "_Text").forecolor = 0
- ancestor = new(script("puppetAudioSeq"), "mRevealOver" && gCurrentQuestion, 1, [[1, "ting"]])
- end
-
- on mRevealOver me
- ancestor = 0
- pState = #NULL
- gTherm.mDoBoardGame()
- end
-
- on mGetQuestion me
- qFields = [#ID, #Char_Code, #question, #Answer_1, #Answer_2, #Answer_3, #Answer_4, #Char_Name, #Answer_Correct, #Vid_File]
- idNum = mGetLRUQuestion(gDB, #VR, [:])
- pInfo = mGetQuestionRecord(gDB, #VO, idNum, qFields)
- PIC = pInfo.Vid_File
- put "F" into qFields.char[2]
- setaProp(pInfo, #Pic_File, PIC)
- member("quizPic").fileName = gPicPath & "questions\" & pInfo.Pic_File & ".jpg"
- mSetQuestionResources(me)
- end
-
- on mSetQuestionResources me
- member("Question_Text").text = pInfo.question
- member("Answer1_Text").text = pInfo.Answer_1
- member("Answer1_Text").forecolor = 255
- member("Answer2_Text").text = pInfo.Answer_2
- member("Answer2_Text").forecolor = 255
- member("Answer3_Text").text = pInfo.Answer_3
- member("Answer3_Text").forecolor = 255
- member("Answer4_Text").text = pInfo.Answer_4
- member("Answer4_Text").forecolor = 255
- end
-
- on mQuestionOver me
- if pVRCount < 1 then
- go("static")
- else
- pVRCount = pVRCount - 1
- mGetVRQuestion(me)
- end if
- end
-
- on mGetVRQuestion me
- qFields = [#ID, #question, #Answer_1, #Answer_2, #Answer_3, #Answer_4, #Char_Name, #Answer_Correct]
- idNum = mGetLRUQuestion(gDB, #VR, [:])
- pInfo = mGetQuestionRecord(gDB, #VO, idNum, qFields)
- mSetQuestionResources(me)
- go("VRQuestion")
- end
-